using System;
using System.Collections;
using System.Data.SqlClient;

using LocalBoard.Domain;
using LocalBoard.Persistence;

using NUnit.Framework;

namespace LocalBoard.Domain
{
	/// <summary>
	/// Summary description for TestMessage.
	/// </summary>
	[TestFixture]
	public class TestMessage
	{
		private Message _unitUnderTest = null;

		[SetUp]
		public void setUp()
		{
			_unitUnderTest = new Message("test", "testBody", "username", "userid", Profile.CreateProfile("userId", "userName", "password", "email", "photo", "customInfo"), 1, 1, 0);
		}

		[TearDown]
		public void tearDown()
		{
			_unitUnderTest = null;
		}

		[Test]
		public void testSetX()
		{
			Assert.AreEqual("", _unitUnderTest.X);
			_unitUnderTest.X = 12;
			Assert.AreEqual(12, _unitUnderTest.X);
			Assert.AreEqual("<Message x=\"12\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetY()
		{
			Assert.AreEqual("", _unitUnderTest.Y);
			_unitUnderTest.Y = 15;
			Assert.AreEqual(15, _unitUnderTest.Y);
			Assert.AreEqual("<Message y=\"15\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testSetZ()
		{
			Assert.AreEqual("", _unitUnderTest.Z);
			_unitUnderTest.Z = 20;
			Assert.AreEqual(20, _unitUnderTest.Z);
			Assert.AreEqual("<Message z=\"20\" />", _unitUnderTest.DataXml.OuterXml);
		}

		[Test]
		public void testGetAndSetX()
		{
			_unitUnderTest = new Message("test", "testBody", "username", "userid", Profile.CreateProfile("userId", "userName", "password", "email", "photo", "customInfo"), 1, 1, 0, "<Message x=\"25\" />");
			Assert.AreEqual(25, _unitUnderTest.X);
			_unitUnderTest.X = 35;
			Assert.AreEqual("<Message x=\"35\" />", _unitUnderTest.DataXml.OuterXml);
		}
	}
}